# Visitor message bot
# by Cee Pee

import forumapi

def settings(settings):
	settings.add_arg("user", type="int", help="user ID to post to")
	settings.add_arg("text", help="text to post")

def main(me, options, args):
	user = forumapi.User(me, id=args.user)
	print(repr(forumapi.get_attr("VisitorMessage").post_visitor_message(user, args.text)))

if __name__ == "__main__":
	forumapi.run(main, options=settings, supported_types=["vbulletin"])
